< previous page page_5 next page >

Page 5
can get help on a particular control in the toolbox by clicking the icon and pressing F1 to activate Visual Basic help.
Tool Tips are also available in Visual Basic 5. Simply rest the mouse pointer on any icon to view a pop-up description of that item. This option can be toggled on and off by selecting Tools | Options, choosing the General tab, and then checking the Show ToolTips checkbox.

Next you need to set a few of the control's properties to indicate the database and data table you want to access.
Setting the DatabaseName and RecordSource Properties
You must first set the following two properties when linking a data control to a database:
DatabaseName
Selected database
RecordSource
Selected data table in the database

The BOOKS5.MDB database will be used in the exercise that follows. This database can be found in the TYSDBVB5\Source\Data directory on the CD that shipped with this book.
Tip.gif
If you do not see the Properties dialog box, press F4 or select View | Properties Window from the menu, or click the properties icon on the Visual Basic toolbar at the top of the screen.

To set the DatabaseName of the data control, first select the data control by single-clicking the control (the data control will already be selected if you did not click anywhere else on the form after you double-clicked the data control in the Toolbox). This forces the data control properties to appear in the Visual Basic Properties dialog box. Locate the DatabaseName property (properties are listed in either alphabetical or categorical order, depending upon the tab you select in the Properties box), and click the property name. When you do this, three small dots (. . .), the properties ellipsis button, appear to the right of the data entry box. Clicking the ellipsis button brings up the Windows standard File | Open dialog box. You should now be able to select the BOOKS5.MDB file from the list of available database files (\\TYSDBVB5\SOURCE\DATA\BOOKS5.MDB). Your screen should look something like the one in Figure 1.2.

 
< previous page page_5 next page >

If you like this book, buy it!